﻿{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>模版列表</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link" href="javascript:location.replace(location.href);">
                            <i class="glyphicon glyphicon-refresh"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-3">
                            <!--操作栏-->
                            <a class="btn btn-primary" href="javascript:createTable();">
                                <i class="fa fa-paste"></i> 创建
                            </a>
                        </div>
                    </div>
                    <input type="hidden" id="checkItem">
                    <div class="table-responsive">
                        <table class="table table-striped table-hover">
                            <thead>
                            <!--表格头部-->
                            <tr>
                                <th><input type="checkbox" class="i-checks" name="input[]" id="text_box"></th>

                                <!--变化列-->
                                <th>数据表</th>
                                <th>注释</th>
                                <!--变化列-->

                            </tr>
                            <!--/表格头部-->
                            </thead>
                            <tbody id="pageView">
                            {foreach $tables as $vo}
                            <tr>
                                <td><input type="checkbox" value="{$vo.name}@{$vo.comment}"
                                           id="i-checks-{$vo.name}@{$vo.comment}" class="i-checks" name="id"></td>
                                <td>{$vo.name}</td>
                                <td>{$vo.comment}</td>
                            </tr>
                            {/foreach}
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
{include file="public/footer" /}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
    //全选、反选
    $('#text_box').on('ifChecked', function (event) {
        $("input[name='id']").iCheck('check');
    });
    $('#text_box').on('ifUnchecked', function (event) {
        $("input[name='id']").iCheck('uncheck');
    });

    function createTable() {
        //批量删除 获取选中id数组
        var chk_value = [];
        $('input[name="id"]:checked').each(function () {
            chk_value.push($(this).val());
        });
        if (chk_value == undefined || chk_value == '') {
            layer.msg('请先选择表格！', {icon: 2});
            return;
        }
        $("#checkItem").val(chk_value);
        layer_open('init','配置');
    }
</script>
<!--/请在上方写此页面业务相关的脚本-->
